package com.bustle.product.webservice;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebParam;
import javax.jws.WebService;

import com.bustle.product.ProductDtoManager;
import com.bustle.product.data.Product.ProductType;
import com.bustle.product.dto.product.ProductDto;

@WebService
public interface ProductDtoWebService
{

  public List<ProductDto> getListProduct();
  public ProductDto getById(@WebParam(name = "idProduct") int idProduct);
  public List<ProductType> getProductType();
  public List<ProductDto> getSearchProductTypeProvider(@WebParam(name = "productType") ProductType productType, @WebParam(name = "idProvider") int idProvider);
  public List<ProductDto> getSearchProductProductType(@WebParam(name = "productType") ProductType productType);
  public List<ProductDto> getSearchProductProvider(@WebParam(name = "idProvider") int idProvider);


  @Stateless
  @WebService(endpointInterface = "com.bustle.product.webservice.ProductDtoWebService")
  public class DefaultProductDtoWebService implements ProductDtoWebService
  {

    @EJB
    protected ProductDtoManager productDtoManager;

    @Override
    public List<ProductDto> getListProduct()
    {
      return productDtoManager.getListProduct();
    }

    @Override
    public ProductDto getById(int paramIdProduct)
    {
      return productDtoManager.getById(paramIdProduct);
    }

    @Override
    public List<ProductType> getProductType()
    {
      return productDtoManager.getProductType();
    }

    @Override
    public List<ProductDto> getSearchProductTypeProvider(ProductType paramProductType, int paramIdProvider)
    {
      return productDtoManager.getSearchProductTypeProvider(paramProductType, paramIdProvider);
    }

    @Override
    public List<ProductDto> getSearchProductProductType(ProductType paramProductType)
    {
      return productDtoManager.getSearchProductProductType(paramProductType);
    }

    @Override
    public List<ProductDto> getSearchProductProvider(int paramIdProvider)
    {
      return productDtoManager.getSearchProductProvider(paramIdProvider);
    }


  }


}
